/*
 * --------------------------------------------------------------
 * Copyright ©  2015 Hangzhou DtDream Technologies Co.,Ltd.
 * --------------------------------------------------------------
 *      Product: 协同数治
 *  Module Name: design
 * Date Created: 2023/3/14
 *  Description: TODO
 * --------------------------------------------------------------
 * Modification History
 * DATE            NAME            Description
 * --------------------------------------------------------------
 * 2023/3/14       yewj            TODO
 * --------------------------------------------------------------
 */

package com.dtdream.pattern.strategy.improve;

/**
 * TODO
 *
 * @Author: yewj
 **/
public abstract class Duck {

    protected FlyBehavior flyBehavior;

    public Duck() {
    }

    public abstract void display();

    public void quack() {
        System.out.println("鸭子嘎嘎叫-----");
    }

    public void swim() {
        System.out.println("鸭子会游泳-----");
    }

    public void fly() {
        if (flyBehavior != null) {
            flyBehavior.fly();
        }
    }
}
